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

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

            try
            {
                _orginatingEntityID.unmarshal(dis);
                _infraredSignatureRepresentationIndex          = dis.readUshort();
                _acousticSignatureRepresentationIndex          = dis.readUshort();
                _radarCrossSectionSignatureRepresentationIndex = dis.readUshort();
                _numberOfPropulsionSystems      = dis.readUshort();
                _numberOfVectoringNozzleSystems = dis.readUshort();
                for (int idx = 0; idx < _numberOfPropulsionSystems; idx++)
                {
                    PropulsionSystemData anX = new PropulsionSystemData();
                    anX.unmarshal(dis);
                    _propulsionSystemData.Add(anX);
                }
                ;

                for (int idx = 0; idx < _numberOfVectoringNozzleSystems; idx++)
                {
                    VectoringNozzleSystemData anX = new VectoringNozzleSystemData();
                    anX.unmarshal(dis);
                    _vectoringSystemData.Add(anX);
                }
                ;
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of unmarshal method
Exemplo n.º 2
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
            {
                _orginatingEntityID.marshal(dos);
                dos.writeUshort((ushort)_infraredSignatureRepresentationIndex);
                dos.writeUshort((ushort)_acousticSignatureRepresentationIndex);
                dos.writeUshort((ushort)_radarCrossSectionSignatureRepresentationIndex);
                dos.writeUshort((ushort)_propulsionSystemData.Count);
                dos.writeUshort((ushort)_vectoringSystemData.Count);

                for (int idx = 0; idx < _propulsionSystemData.Count; idx++)
                {
                    PropulsionSystemData aPropulsionSystemData = (PropulsionSystemData)_propulsionSystemData[idx];
                    aPropulsionSystemData.marshal(dos);
                } // end of list marshalling


                for (int idx = 0; idx < _vectoringSystemData.Count; idx++)
                {
                    VectoringNozzleSystemData aVectoringNozzleSystemData = (VectoringNozzleSystemData)_vectoringSystemData[idx];
                    aVectoringNozzleSystemData.marshal(dos);
                } // end of list marshalling
            }     // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
Exemplo n.º 3
0
        /**
         * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
         */
        public bool equals(SeesPdu rhs)
        {
            bool ivarsEqual = true;

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

            if (!(_orginatingEntityID.Equals(rhs._orginatingEntityID)))
            {
                ivarsEqual = false;
            }
            if (!(_infraredSignatureRepresentationIndex == rhs._infraredSignatureRepresentationIndex))
            {
                ivarsEqual = false;
            }
            if (!(_acousticSignatureRepresentationIndex == rhs._acousticSignatureRepresentationIndex))
            {
                ivarsEqual = false;
            }
            if (!(_radarCrossSectionSignatureRepresentationIndex == rhs._radarCrossSectionSignatureRepresentationIndex))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfPropulsionSystems == rhs._numberOfPropulsionSystems))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfVectoringNozzleSystems == rhs._numberOfVectoringNozzleSystems))
            {
                ivarsEqual = false;
            }

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


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


            return(ivarsEqual);
        }
Exemplo n.º 4
0
        /**
         * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
         */
        public bool equals(PropulsionSystemData rhs)
        {
            bool ivarsEqual = true;

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

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

            return(ivarsEqual);
        }
Exemplo n.º 5
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("<SeesPdu>" + System.Environment.NewLine);
            base.reflection(sb);
            try
            {
                sb.Append("<orginatingEntityID>" + System.Environment.NewLine);
                _orginatingEntityID.reflection(sb);
                sb.Append("</orginatingEntityID>" + System.Environment.NewLine);
                sb.Append("<infraredSignatureRepresentationIndex type=\"ushort\">" + _infraredSignatureRepresentationIndex.ToString() + "</infraredSignatureRepresentationIndex> " + System.Environment.NewLine);
                sb.Append("<acousticSignatureRepresentationIndex type=\"ushort\">" + _acousticSignatureRepresentationIndex.ToString() + "</acousticSignatureRepresentationIndex> " + System.Environment.NewLine);
                sb.Append("<radarCrossSectionSignatureRepresentationIndex type=\"ushort\">" + _radarCrossSectionSignatureRepresentationIndex.ToString() + "</radarCrossSectionSignatureRepresentationIndex> " + System.Environment.NewLine);
                sb.Append("<propulsionSystemData type=\"ushort\">" + _propulsionSystemData.Count.ToString() + "</propulsionSystemData> " + System.Environment.NewLine);
                sb.Append("<vectoringSystemData type=\"ushort\">" + _vectoringSystemData.Count.ToString() + "</vectoringSystemData> " + System.Environment.NewLine);

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


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

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

            marshalSize = base.getMarshalledSize();
            marshalSize = marshalSize + _orginatingEntityID.getMarshalledSize(); // _orginatingEntityID
            marshalSize = marshalSize + 2;                                       // _infraredSignatureRepresentationIndex
            marshalSize = marshalSize + 2;                                       // _acousticSignatureRepresentationIndex
            marshalSize = marshalSize + 2;                                       // _radarCrossSectionSignatureRepresentationIndex
            marshalSize = marshalSize + 2;                                       // _numberOfPropulsionSystems
            marshalSize = marshalSize + 2;                                       // _numberOfVectoringNozzleSystems
            for (int idx = 0; idx < _propulsionSystemData.Count; idx++)
            {
                PropulsionSystemData listElement = (PropulsionSystemData)_propulsionSystemData[idx];
                marshalSize = marshalSize + listElement.getMarshalledSize();
            }
            for (int idx = 0; idx < _vectoringSystemData.Count; idx++)
            {
                VectoringNozzleSystemData listElement = (VectoringNozzleSystemData)_vectoringSystemData[idx];
                marshalSize = marshalSize + listElement.getMarshalledSize();
            }

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

            try
            {
               _orginatingEntityID.unmarshal(dis);
               _infraredSignatureRepresentationIndex = dis.readUshort();
               _acousticSignatureRepresentationIndex = dis.readUshort();
               _radarCrossSectionSignatureRepresentationIndex = dis.readUshort();
               _numberOfPropulsionSystems = dis.readUshort();
               _numberOfVectoringNozzleSystems = dis.readUshort();
            for(int idx = 0; idx < _numberOfPropulsionSystems; idx++)
            {
               PropulsionSystemData anX = new PropulsionSystemData();
            anX.unmarshal(dis);
            _propulsionSystemData.Add(anX);
            };

            for(int idx = 0; idx < _numberOfVectoringNozzleSystems; idx++)
            {
               VectoringNozzleSystemData anX = new VectoringNozzleSystemData();
            anX.unmarshal(dis);
            _vectoringSystemData.Add(anX);
            };

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

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

            if( ! (_powerSetting == rhs._powerSetting)) ivarsEqual = false;
            if( ! (_engineRpm == rhs._engineRpm)) ivarsEqual = false;

            return ivarsEqual;
        }