Exemplo n.º 1
0
        } // end of unmarshal method

        ///<summary>
        ///This allows for a quick display of PDU data.  The current format is unacceptable and only used for debugging.
        ///This will be modified in the future to provide a better display.  Usage:
        ///pdu.GetType().InvokeMember("reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
        ///where pdu is an object representing a single pdu and sb is a StringBuilder.
        ///Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
        ///</summary>
        new public void reflection(StringBuilder sb)
        {
            sb.Append("<DetonationPdu>" + System.Environment.NewLine);
            base.reflection(sb);
            try
            {
                sb.Append("<munitionID>" + System.Environment.NewLine);
                _munitionID.reflection(sb);
                sb.Append("</munitionID>" + System.Environment.NewLine);
                sb.Append("<eventID>" + System.Environment.NewLine);
                _eventID.reflection(sb);
                sb.Append("</eventID>" + System.Environment.NewLine);
                sb.Append("<velocity>" + System.Environment.NewLine);
                _velocity.reflection(sb);
                sb.Append("</velocity>" + System.Environment.NewLine);
                sb.Append("<locationInWorldCoordinates>" + System.Environment.NewLine);
                _locationInWorldCoordinates.reflection(sb);
                sb.Append("</locationInWorldCoordinates>" + System.Environment.NewLine);
                sb.Append("<burstDescriptor>" + System.Environment.NewLine);
                _burstDescriptor.reflection(sb);
                sb.Append("</burstDescriptor>" + System.Environment.NewLine);
                sb.Append("<locationInEntityCoordinates>" + System.Environment.NewLine);
                _locationInEntityCoordinates.reflection(sb);
                sb.Append("</locationInEntityCoordinates>" + System.Environment.NewLine);
                sb.Append("<detonationResult type=\"byte\">" + _detonationResult.ToString() + "</detonationResult> " + System.Environment.NewLine);
                sb.Append("<articulationParameters type=\"byte\">" + _articulationParameters.Count.ToString() + "</articulationParameters> " + System.Environment.NewLine);
                sb.Append("<pad type=\"short\">" + _pad.ToString() + "</pad> " + System.Environment.NewLine);

                for (int idx = 0; idx < _articulationParameters.Count; idx++)
                {
                    sb.Append("<articulationParameters" + idx.ToString() + " type=\"ArticulationParameter\">" + System.Environment.NewLine);
                    ArticulationParameter aArticulationParameter = (ArticulationParameter)_articulationParameters[idx];
                    aArticulationParameter.reflection(sb);
                    sb.Append("</articulationParameters" + idx.ToString() + ">" + System.Environment.NewLine);
                } // end of list marshalling

                sb.Append("</DetonationPdu>" + System.Environment.NewLine);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
        new public int getMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize = base.getMarshalledSize();
            marshalSize = marshalSize + _entityID.getMarshalledSize();             // _entityID
            marshalSize = marshalSize + 1;                                         // _padding1
            marshalSize = marshalSize + 1;                                         // _numberOfArticulationParameters
            marshalSize = marshalSize + _entityLinearVelocity.getMarshalledSize(); // _entityLinearVelocity
            marshalSize = marshalSize + _entityLocation.getMarshalledSize();       // _entityLocation
            marshalSize = marshalSize + _entityOrientation.getMarshalledSize();    // _entityOrientation
            marshalSize = marshalSize + 4;                                         // _entityAppearance
            for (int idx = 0; idx < _articulationParameters.Count; idx++)
            {
                ArticulationParameter listElement = (ArticulationParameter)_articulationParameters[idx];
                marshalSize = marshalSize + listElement.getMarshalledSize();
            }

            return(marshalSize);
        }
Exemplo n.º 3
0
        new public int getMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize = base.getMarshalledSize();
            marshalSize = marshalSize + _munitionID.getMarshalledSize();                  // _munitionID
            marshalSize = marshalSize + _eventID.getMarshalledSize();                     // _eventID
            marshalSize = marshalSize + _velocity.getMarshalledSize();                    // _velocity
            marshalSize = marshalSize + _locationInWorldCoordinates.getMarshalledSize();  // _locationInWorldCoordinates
            marshalSize = marshalSize + _burstDescriptor.getMarshalledSize();             // _burstDescriptor
            marshalSize = marshalSize + _locationInEntityCoordinates.getMarshalledSize(); // _locationInEntityCoordinates
            marshalSize = marshalSize + 1;                                                // _detonationResult
            marshalSize = marshalSize + 1;                                                // _numberOfArticulationParameters
            marshalSize = marshalSize + 2;                                                // _pad
            for (int idx = 0; idx < _articulationParameters.Count; idx++)
            {
                ArticulationParameter listElement = (ArticulationParameter)_articulationParameters[idx];
                marshalSize = marshalSize + listElement.getMarshalledSize();
            }

            return(marshalSize);
        }
        } // end of unmarshal method

        ///<summary>
        ///This allows for a quick display of PDU data.  The current format is unacceptable and only used for debugging.
        ///This will be modified in the future to provide a better display.  Usage:
        ///pdu.GetType().InvokeMember("reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
        ///where pdu is an object representing a single pdu and sb is a StringBuilder.
        ///Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
        ///</summary>
        new public void reflection(StringBuilder sb)
        {
            sb.Append("<EntityStateUpdatePdu>" + System.Environment.NewLine);
            base.reflection(sb);
            try
            {
                sb.Append("<entityID>" + System.Environment.NewLine);
                _entityID.reflection(sb);
                sb.Append("</entityID>" + System.Environment.NewLine);
                sb.Append("<padding1 type=\"byte\">" + _padding1.ToString() + "</padding1> " + System.Environment.NewLine);
                sb.Append("<articulationParameters type=\"byte\">" + _articulationParameters.Count.ToString() + "</articulationParameters> " + System.Environment.NewLine);
                sb.Append("<entityLinearVelocity>" + System.Environment.NewLine);
                _entityLinearVelocity.reflection(sb);
                sb.Append("</entityLinearVelocity>" + System.Environment.NewLine);
                sb.Append("<entityLocation>" + System.Environment.NewLine);
                _entityLocation.reflection(sb);
                sb.Append("</entityLocation>" + System.Environment.NewLine);
                sb.Append("<entityOrientation>" + System.Environment.NewLine);
                _entityOrientation.reflection(sb);
                sb.Append("</entityOrientation>" + System.Environment.NewLine);
                sb.Append("<entityAppearance type=\"uint\">" + _entityAppearance.ToString() + "</entityAppearance> " + System.Environment.NewLine);

                for (int idx = 0; idx < _articulationParameters.Count; idx++)
                {
                    sb.Append("<articulationParameters" + idx.ToString() + " type=\"ArticulationParameter\">" + System.Environment.NewLine);
                    ArticulationParameter aArticulationParameter = (ArticulationParameter)_articulationParameters[idx];
                    aArticulationParameter.reflection(sb);
                    sb.Append("</articulationParameters" + idx.ToString() + ">" + System.Environment.NewLine);
                } // end of list marshalling

                sb.Append("</EntityStateUpdatePdu>" + System.Environment.NewLine);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of reflection method
Exemplo n.º 5
0
        /**
         * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
         */
        public bool equals(EntityStatePdu rhs)
        {
            bool ivarsEqual = true;

            if (rhs.GetType() != this.GetType())
            {
                return(false);
            }

            if (!(_entityID.Equals(rhs._entityID)))
            {
                ivarsEqual = false;
            }
            if (!(_forceId == rhs._forceId))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfArticulationParameters == rhs._numberOfArticulationParameters))
            {
                ivarsEqual = false;
            }
            if (!(_entityType.Equals(rhs._entityType)))
            {
                ivarsEqual = false;
            }
            if (!(_alternativeEntityType.Equals(rhs._alternativeEntityType)))
            {
                ivarsEqual = false;
            }
            if (!(_entityLinearVelocity.Equals(rhs._entityLinearVelocity)))
            {
                ivarsEqual = false;
            }
            if (!(_entityLocation.Equals(rhs._entityLocation)))
            {
                ivarsEqual = false;
            }
            if (!(_entityOrientation.Equals(rhs._entityOrientation)))
            {
                ivarsEqual = false;
            }
            if (!(_entityAppearance == rhs._entityAppearance))
            {
                ivarsEqual = false;
            }
            if (!(_deadReckoningParameters.Equals(rhs._deadReckoningParameters)))
            {
                ivarsEqual = false;
            }
            if (!(_marking.Equals(rhs._marking)))
            {
                ivarsEqual = false;
            }
            if (!(_capabilities == rhs._capabilities))
            {
                ivarsEqual = false;
            }

            for (int idx = 0; idx < _articulationParameters.Count; idx++)
            {
                ArticulationParameter x = (ArticulationParameter)_articulationParameters[idx];
                if (!(_articulationParameters[idx].Equals(rhs._articulationParameters[idx])))
                {
                    ivarsEqual = false;
                }
            }


            return(ivarsEqual);
        }
Exemplo n.º 6
0
        public new void unmarshal(DataInputStream dis)
        {
            base.unmarshal(dis);

            try
            {
               _entityID.unmarshal(dis);
               _forceId = dis.readByte();
               _numberOfArticulationParameters = dis.readByte();
               _entityType.unmarshal(dis);
               _alternativeEntityType.unmarshal(dis);
               _entityLinearVelocity.unmarshal(dis);
               _entityLocation.unmarshal(dis);
               _entityOrientation.unmarshal(dis);
               _entityAppearance = dis.readUint();
               _deadReckoningParameters.unmarshal(dis);
               _marking.unmarshal(dis);
               _capabilities = dis.readUint();
            for(int idx = 0; idx < _numberOfArticulationParameters; idx++)
            {
               ArticulationParameter anX = new ArticulationParameter();
            anX.unmarshal(dis);
            _articulationParameters.Add(anX);
            };

            } // end try
               catch(Exception e)
            {
              Trace.WriteLine(e);
              Trace.Flush();
            }
        }
Exemplo n.º 7
0
        /**
         * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
         */
        public bool equals(FastEntityStatePdu rhs)
        {
            bool ivarsEqual = true;

            if (rhs.GetType() != this.GetType())
            {
                return(false);
            }

            if (!(_site == rhs._site))
            {
                ivarsEqual = false;
            }
            if (!(_application == rhs._application))
            {
                ivarsEqual = false;
            }
            if (!(_entity == rhs._entity))
            {
                ivarsEqual = false;
            }
            if (!(_forceId == rhs._forceId))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfArticulationParameters == rhs._numberOfArticulationParameters))
            {
                ivarsEqual = false;
            }
            if (!(_entityKind == rhs._entityKind))
            {
                ivarsEqual = false;
            }
            if (!(_domain == rhs._domain))
            {
                ivarsEqual = false;
            }
            if (!(_country == rhs._country))
            {
                ivarsEqual = false;
            }
            if (!(_category == rhs._category))
            {
                ivarsEqual = false;
            }
            if (!(_subcategory == rhs._subcategory))
            {
                ivarsEqual = false;
            }
            if (!(_specific == rhs._specific))
            {
                ivarsEqual = false;
            }
            if (!(_extra == rhs._extra))
            {
                ivarsEqual = false;
            }
            if (!(_altEntityKind == rhs._altEntityKind))
            {
                ivarsEqual = false;
            }
            if (!(_altDomain == rhs._altDomain))
            {
                ivarsEqual = false;
            }
            if (!(_altCountry == rhs._altCountry))
            {
                ivarsEqual = false;
            }
            if (!(_altCategory == rhs._altCategory))
            {
                ivarsEqual = false;
            }
            if (!(_altSubcategory == rhs._altSubcategory))
            {
                ivarsEqual = false;
            }
            if (!(_altSpecific == rhs._altSpecific))
            {
                ivarsEqual = false;
            }
            if (!(_altExtra == rhs._altExtra))
            {
                ivarsEqual = false;
            }
            if (!(_xVelocity == rhs._xVelocity))
            {
                ivarsEqual = false;
            }
            if (!(_yVelocity == rhs._yVelocity))
            {
                ivarsEqual = false;
            }
            if (!(_zVelocity == rhs._zVelocity))
            {
                ivarsEqual = false;
            }
            if (!(_xLocation == rhs._xLocation))
            {
                ivarsEqual = false;
            }
            if (!(_yLocation == rhs._yLocation))
            {
                ivarsEqual = false;
            }
            if (!(_zLocation == rhs._zLocation))
            {
                ivarsEqual = false;
            }
            if (!(_psi == rhs._psi))
            {
                ivarsEqual = false;
            }
            if (!(_theta == rhs._theta))
            {
                ivarsEqual = false;
            }
            if (!(_phi == rhs._phi))
            {
                ivarsEqual = false;
            }
            if (!(_entityAppearance == rhs._entityAppearance))
            {
                ivarsEqual = false;
            }
            if (!(_deadReckoningAlgorithm == rhs._deadReckoningAlgorithm))
            {
                ivarsEqual = false;
            }

            for (int idx = 0; idx < 15; idx++)
            {
                if (!(_otherParameters[idx] == rhs._otherParameters[idx]))
                {
                    ivarsEqual = false;
                }
            }

            if (!(_xAcceleration == rhs._xAcceleration))
            {
                ivarsEqual = false;
            }
            if (!(_yAcceleration == rhs._yAcceleration))
            {
                ivarsEqual = false;
            }
            if (!(_zAcceleration == rhs._zAcceleration))
            {
                ivarsEqual = false;
            }
            if (!(_xAngularVelocity == rhs._xAngularVelocity))
            {
                ivarsEqual = false;
            }
            if (!(_yAngularVelocity == rhs._yAngularVelocity))
            {
                ivarsEqual = false;
            }
            if (!(_zAngularVelocity == rhs._zAngularVelocity))
            {
                ivarsEqual = false;
            }

            for (int idx = 0; idx < 12; idx++)
            {
                if (!(_marking[idx] == rhs._marking[idx]))
                {
                    ivarsEqual = false;
                }
            }

            if (!(_capabilities == rhs._capabilities))
            {
                ivarsEqual = false;
            }

            for (int idx = 0; idx < _articulationParameters.Count; idx++)
            {
                ArticulationParameter x = (ArticulationParameter)_articulationParameters[idx];
                if (!(_articulationParameters[idx].Equals(rhs._articulationParameters[idx])))
                {
                    ivarsEqual = false;
                }
            }


            return(ivarsEqual);
        }
Exemplo n.º 8
0
        } // end of unmarshal method

        ///<summary>
        ///This allows for a quick display of PDU data.  The current format is unacceptable and only used for debugging.
        ///This will be modified in the future to provide a better display.  Usage:
        ///pdu.GetType().InvokeMember("reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
        ///where pdu is an object representing a single pdu and sb is a StringBuilder.
        ///Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
        ///</summary>
        new public void reflection(StringBuilder sb)
        {
            sb.Append("<FastEntityStatePdu>" + System.Environment.NewLine);
            base.reflection(sb);
            try
            {
                sb.Append("<site type=\"ushort\">" + _site.ToString() + "</site> " + System.Environment.NewLine);
                sb.Append("<application type=\"ushort\">" + _application.ToString() + "</application> " + System.Environment.NewLine);
                sb.Append("<entity type=\"ushort\">" + _entity.ToString() + "</entity> " + System.Environment.NewLine);
                sb.Append("<forceId type=\"byte\">" + _forceId.ToString() + "</forceId> " + System.Environment.NewLine);
                sb.Append("<articulationParameters type=\"byte\">" + _articulationParameters.Count.ToString() + "</articulationParameters> " + System.Environment.NewLine);
                sb.Append("<entityKind type=\"byte\">" + _entityKind.ToString() + "</entityKind> " + System.Environment.NewLine);
                sb.Append("<domain type=\"byte\">" + _domain.ToString() + "</domain> " + System.Environment.NewLine);
                sb.Append("<country type=\"ushort\">" + _country.ToString() + "</country> " + System.Environment.NewLine);
                sb.Append("<category type=\"byte\">" + _category.ToString() + "</category> " + System.Environment.NewLine);
                sb.Append("<subcategory type=\"byte\">" + _subcategory.ToString() + "</subcategory> " + System.Environment.NewLine);
                sb.Append("<specific type=\"byte\">" + _specific.ToString() + "</specific> " + System.Environment.NewLine);
                sb.Append("<extra type=\"byte\">" + _extra.ToString() + "</extra> " + System.Environment.NewLine);
                sb.Append("<altEntityKind type=\"byte\">" + _altEntityKind.ToString() + "</altEntityKind> " + System.Environment.NewLine);
                sb.Append("<altDomain type=\"byte\">" + _altDomain.ToString() + "</altDomain> " + System.Environment.NewLine);
                sb.Append("<altCountry type=\"ushort\">" + _altCountry.ToString() + "</altCountry> " + System.Environment.NewLine);
                sb.Append("<altCategory type=\"byte\">" + _altCategory.ToString() + "</altCategory> " + System.Environment.NewLine);
                sb.Append("<altSubcategory type=\"byte\">" + _altSubcategory.ToString() + "</altSubcategory> " + System.Environment.NewLine);
                sb.Append("<altSpecific type=\"byte\">" + _altSpecific.ToString() + "</altSpecific> " + System.Environment.NewLine);
                sb.Append("<altExtra type=\"byte\">" + _altExtra.ToString() + "</altExtra> " + System.Environment.NewLine);
                sb.Append("<xVelocity type=\"float\">" + _xVelocity.ToString() + "</xVelocity> " + System.Environment.NewLine);
                sb.Append("<yVelocity type=\"float\">" + _yVelocity.ToString() + "</yVelocity> " + System.Environment.NewLine);
                sb.Append("<zVelocity type=\"float\">" + _zVelocity.ToString() + "</zVelocity> " + System.Environment.NewLine);
                sb.Append("<xLocation type=\"double\">" + _xLocation.ToString() + "</xLocation> " + System.Environment.NewLine);
                sb.Append("<yLocation type=\"double\">" + _yLocation.ToString() + "</yLocation> " + System.Environment.NewLine);
                sb.Append("<zLocation type=\"double\">" + _zLocation.ToString() + "</zLocation> " + System.Environment.NewLine);
                sb.Append("<psi type=\"float\">" + _psi.ToString() + "</psi> " + System.Environment.NewLine);
                sb.Append("<theta type=\"float\">" + _theta.ToString() + "</theta> " + System.Environment.NewLine);
                sb.Append("<phi type=\"float\">" + _phi.ToString() + "</phi> " + System.Environment.NewLine);
                sb.Append("<entityAppearance type=\"uint\">" + _entityAppearance.ToString() + "</entityAppearance> " + System.Environment.NewLine);
                sb.Append("<deadReckoningAlgorithm type=\"byte\">" + _deadReckoningAlgorithm.ToString() + "</deadReckoningAlgorithm> " + System.Environment.NewLine);

                for (int idx = 0; idx < _otherParameters.Length; idx++)
                {
                    sb.Append("<otherParameters" + idx.ToString() + " type=\"byte\">" + _otherParameters[idx] + "</otherParameters" + idx.ToString() + "> " + System.Environment.NewLine);
                } // end of array reflection

                sb.Append("<xAcceleration type=\"float\">" + _xAcceleration.ToString() + "</xAcceleration> " + System.Environment.NewLine);
                sb.Append("<yAcceleration type=\"float\">" + _yAcceleration.ToString() + "</yAcceleration> " + System.Environment.NewLine);
                sb.Append("<zAcceleration type=\"float\">" + _zAcceleration.ToString() + "</zAcceleration> " + System.Environment.NewLine);
                sb.Append("<xAngularVelocity type=\"float\">" + _xAngularVelocity.ToString() + "</xAngularVelocity> " + System.Environment.NewLine);
                sb.Append("<yAngularVelocity type=\"float\">" + _yAngularVelocity.ToString() + "</yAngularVelocity> " + System.Environment.NewLine);
                sb.Append("<zAngularVelocity type=\"float\">" + _zAngularVelocity.ToString() + "</zAngularVelocity> " + System.Environment.NewLine);

                for (int idx = 0; idx < _marking.Length; idx++)
                {
                    sb.Append("<marking" + idx.ToString() + " type=\"byte\">" + _marking[idx] + "</marking" + idx.ToString() + "> " + System.Environment.NewLine);
                } // end of array reflection

                sb.Append("<capabilities type=\"uint\">" + _capabilities.ToString() + "</capabilities> " + System.Environment.NewLine);

                for (int idx = 0; idx < _articulationParameters.Count; idx++)
                {
                    sb.Append("<articulationParameters" + idx.ToString() + " type=\"ArticulationParameter\">" + System.Environment.NewLine);
                    ArticulationParameter aArticulationParameter = (ArticulationParameter)_articulationParameters[idx];
                    aArticulationParameter.reflection(sb);
                    sb.Append("</articulationParameters" + idx.ToString() + ">" + System.Environment.NewLine);
                } // end of list marshalling

                sb.Append("</FastEntityStatePdu>" + System.Environment.NewLine);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
Exemplo n.º 9
0
        } // end of marshal method

        new public void unmarshal(DataInputStream dis)
        {
            base.unmarshal(dis);

            try
            {
                _site        = dis.readUshort();
                _application = dis.readUshort();
                _entity      = dis.readUshort();
                _forceId     = dis.readByte();
                _numberOfArticulationParameters = dis.readByte();
                _entityKind             = dis.readByte();
                _domain                 = dis.readByte();
                _country                = dis.readUshort();
                _category               = dis.readByte();
                _subcategory            = dis.readByte();
                _specific               = dis.readByte();
                _extra                  = dis.readByte();
                _altEntityKind          = dis.readByte();
                _altDomain              = dis.readByte();
                _altCountry             = dis.readUshort();
                _altCategory            = dis.readByte();
                _altSubcategory         = dis.readByte();
                _altSpecific            = dis.readByte();
                _altExtra               = dis.readByte();
                _xVelocity              = dis.readFloat();
                _yVelocity              = dis.readFloat();
                _zVelocity              = dis.readFloat();
                _xLocation              = dis.readDouble();
                _yLocation              = dis.readDouble();
                _zLocation              = dis.readDouble();
                _psi                    = dis.readFloat();
                _theta                  = dis.readFloat();
                _phi                    = dis.readFloat();
                _entityAppearance       = dis.readUint();
                _deadReckoningAlgorithm = dis.readByte();
                for (int idx = 0; idx < _otherParameters.Length; idx++)
                {
                    _otherParameters[idx] = dis.readByte();
                } // end of array unmarshaling
                _xAcceleration    = dis.readFloat();
                _yAcceleration    = dis.readFloat();
                _zAcceleration    = dis.readFloat();
                _xAngularVelocity = dis.readFloat();
                _yAngularVelocity = dis.readFloat();
                _zAngularVelocity = dis.readFloat();
                for (int idx = 0; idx < _marking.Length; idx++)
                {
                    _marking[idx] = dis.readByte();
                } // end of array unmarshaling
                _capabilities = dis.readUint();
                for (int idx = 0; idx < _numberOfArticulationParameters; idx++)
                {
                    ArticulationParameter anX = new ArticulationParameter();
                    anX.unmarshal(dis);
                    _articulationParameters.Add(anX);
                }
                ;
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of unmarshal method
Exemplo n.º 10
0
///<summary>
///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
///</summary>
        new public void marshal(DataOutputStream dos)
        {
            base.marshal(dos);
            try
            {
                dos.writeUshort((ushort)_site);
                dos.writeUshort((ushort)_application);
                dos.writeUshort((ushort)_entity);
                dos.writeByte((byte)_forceId);
                dos.writeByte((byte)_articulationParameters.Count);
                dos.writeByte((byte)_entityKind);
                dos.writeByte((byte)_domain);
                dos.writeUshort((ushort)_country);
                dos.writeByte((byte)_category);
                dos.writeByte((byte)_subcategory);
                dos.writeByte((byte)_specific);
                dos.writeByte((byte)_extra);
                dos.writeByte((byte)_altEntityKind);
                dos.writeByte((byte)_altDomain);
                dos.writeUshort((ushort)_altCountry);
                dos.writeByte((byte)_altCategory);
                dos.writeByte((byte)_altSubcategory);
                dos.writeByte((byte)_altSpecific);
                dos.writeByte((byte)_altExtra);
                dos.writeFloat((float)_xVelocity);
                dos.writeFloat((float)_yVelocity);
                dos.writeFloat((float)_zVelocity);
                dos.writeDouble((double)_xLocation);
                dos.writeDouble((double)_yLocation);
                dos.writeDouble((double)_zLocation);
                dos.writeFloat((float)_psi);
                dos.writeFloat((float)_theta);
                dos.writeFloat((float)_phi);
                dos.writeUint((uint)_entityAppearance);
                dos.writeByte((byte)_deadReckoningAlgorithm);

                for (int idx = 0; idx < _otherParameters.Length; idx++)
                {
                    dos.writeByte(_otherParameters[idx]);
                } // end of array marshaling

                dos.writeFloat((float)_xAcceleration);
                dos.writeFloat((float)_yAcceleration);
                dos.writeFloat((float)_zAcceleration);
                dos.writeFloat((float)_xAngularVelocity);
                dos.writeFloat((float)_yAngularVelocity);
                dos.writeFloat((float)_zAngularVelocity);

                for (int idx = 0; idx < _marking.Length; idx++)
                {
                    dos.writeByte(_marking[idx]);
                } // end of array marshaling

                dos.writeUint((uint)_capabilities);

                for (int idx = 0; idx < _articulationParameters.Count; idx++)
                {
                    ArticulationParameter aArticulationParameter = (ArticulationParameter)_articulationParameters[idx];
                    aArticulationParameter.marshal(dos);
                } // end of list marshalling
            }     // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
        public new void unmarshal(DataInputStream dis)
        {
            base.unmarshal(dis);

            try
            {
               _entityID.unmarshal(dis);
               _padding1 = dis.readByte();
               _numberOfArticulationParameters = dis.readByte();
               _entityLinearVelocity.unmarshal(dis);
               _entityLocation.unmarshal(dis);
               _entityOrientation.unmarshal(dis);
               _entityAppearance = dis.readUint();
            for(int idx = 0; idx < _numberOfArticulationParameters; idx++)
            {
               ArticulationParameter anX = new ArticulationParameter();
            anX.unmarshal(dis);
            _articulationParameters.Add(anX);
            };

            } // end try
               catch(Exception e)
            {
              Trace.WriteLine(e);
              Trace.Flush();
            }
        }
Exemplo n.º 12
0
        public new void unmarshal(DataInputStream dis)
        {
            base.unmarshal(dis);

            try
            {
                _munitionID.unmarshal(dis);
                _eventID.unmarshal(dis);
                _velocity.unmarshal(dis);
                _locationInWorldCoordinates.unmarshal(dis);
                _burstDescriptor.unmarshal(dis);
                _locationInEntityCoordinates.unmarshal(dis);
                _detonationResult = dis.readByte();
                _numberOfArticulationParameters = dis.readByte();
                _pad = dis.readShort();
                for(int idx = 0; idx < _numberOfArticulationParameters; idx++)
                {
                    ArticulationParameter anX = new ArticulationParameter();
                    anX.unmarshal(dis);
                    _articulationParameters.Add(anX);
                };

            } // end try
            catch(Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        }
        /**
         * Compares for reference equality and value equality.
         */
        public bool equals(ArticulationParameter rhs)
        {
            bool ivarsEqual = true;

            if(rhs.GetType() != this.GetType())
                return false;

            if( ! (_parameterTypeDesignator == rhs._parameterTypeDesignator)) ivarsEqual = false;
            if( ! (_changeIndicator == rhs._changeIndicator)) ivarsEqual = false;
            if( ! (_partAttachedTo == rhs._partAttachedTo)) ivarsEqual = false;
            if( ! (_parameterType == rhs._parameterType)) ivarsEqual = false;
            if( ! (_parameterValue == rhs._parameterValue)) ivarsEqual = false;

            return ivarsEqual;
        }
        public new void unmarshal(DataInputStream dis)
        {
            base.unmarshal(dis);

            try
            {
               _site = dis.readUshort();
               _application = dis.readUshort();
               _entity = dis.readUshort();
               _forceId = dis.readByte();
               _numberOfArticulationParameters = dis.readByte();
               _entityKind = dis.readByte();
               _domain = dis.readByte();
               _country = dis.readUshort();
               _category = dis.readByte();
               _subcategory = dis.readByte();
               _specific = dis.readByte();
               _extra = dis.readByte();
               _altEntityKind = dis.readByte();
               _altDomain = dis.readByte();
               _altCountry = dis.readUshort();
               _altCategory = dis.readByte();
               _altSubcategory = dis.readByte();
               _altSpecific = dis.readByte();
               _altExtra = dis.readByte();
               _xVelocity = dis.readFloat();
               _yVelocity = dis.readFloat();
               _zVelocity = dis.readFloat();
               _xLocation = dis.readDouble();
               _yLocation = dis.readDouble();
               _zLocation = dis.readDouble();
               _psi = dis.readFloat();
               _theta = dis.readFloat();
               _phi = dis.readFloat();
               _entityAppearance = dis.readUint();
               _deadReckoningAlgorithm = dis.readByte();
               for(int idx = 0; idx < _otherParameters.Length; idx++)
               {
                _otherParameters[idx] = dis.readByte();
               } // end of array unmarshaling
               _xAcceleration = dis.readFloat();
               _yAcceleration = dis.readFloat();
               _zAcceleration = dis.readFloat();
               _xAngularVelocity = dis.readFloat();
               _yAngularVelocity = dis.readFloat();
               _zAngularVelocity = dis.readFloat();
               for(int idx = 0; idx < _marking.Length; idx++)
               {
                _marking[idx] = dis.readByte();
               } // end of array unmarshaling
               _capabilities = dis.readUint();
            for(int idx = 0; idx < _numberOfArticulationParameters; idx++)
            {
               ArticulationParameter anX = new ArticulationParameter();
            anX.unmarshal(dis);
            _articulationParameters.Add(anX);
            };

            } // end try
               catch(Exception e)
            {
              Trace.WriteLine(e);
              Trace.Flush();
            }
        }